//
//  XMLabelSettingItem.m
//  XMWeibo
//
//  Created by chi on 14-9-1.
//  Copyright (c) 2014年 xiaoming. All rights reserved.
//

#import "XMLabelSettingItem.h"

@implementation XMLabelSettingItem

#pragma mark - 类工厂方法
+ (instancetype)labelCellItemWithTitle:(NSString *)title subTitle:(NSString *)subTitle icon:(NSString *)icon labelText:(NSString *)labelText class:(Class)destVcClass
{
    XMLabelSettingItem *item = [self arrowCellItemWithTitle:title subTitle:subTitle icon:icon class:destVcClass];
    item.labelText = labelText;
    
    return item;
}




- (NSString *)labelText
{
    id value = [[NSUserDefaults standardUserDefaults]objectForKey:self.key];
    
    if (value == nil) {
        return _defaultText;
    }
    
    return value;
}

- (void)setLabelText:(NSString *)labelText
{
    NSUserDefaults *defaluts = [NSUserDefaults standardUserDefaults];
    
    [defaluts setObject:labelText forKey:self.key];
    [defaluts synchronize];
}


@end
